#include <syscall.h>

int	ugetpid(){
	nomalloc_spb.scp_magic = SCP_MAGIC;
	nomalloc_spb.function_id = SC_CLOSE;
	syscall(&nomalloc_spb);
	errno = nomalloc_spb.errno;
	return (int)nomalloc_spb.result;
}

void uexit(int code){
	nomalloc_spb.scp_magic = SCP_MAGIC;
	nomalloc_spb.function_id = SC_EXIT;
	nomalloc_spb.parameters[0] = (uint32_t) code;
	syscall(&nomalloc_spb);
	errno = nomalloc_spb.errno;
}

void *usbrk(uint32_t size){
	nomalloc_spb.scp_magic = SCP_MAGIC;
	nomalloc_spb.function_id = SC_SBRK;
	nomalloc_spb.parameters[0] = size;
	syscall(&nomalloc_spb);
	errno = nomalloc_spb.errno;
	return (void *)nomalloc_spb.result;
}

int uexec(char *filename){
	nomalloc_spb.scp_magic = SCP_MAGIC;
	nomalloc_spb.function_id = SC_EXECVE;
	nomalloc_spb.parameters[0] = (uint32_t) filename;
	syscall(&nomalloc_spb);
	errno = nomalloc_spb.errno;
	return (int)nomalloc_spb.result;
}